<?php

namespace app\index\validate;

use think\Validate;

class BusinessRegister extends Validate
{
    protected $rule = [
        'businessType'          => 'number|in:0,1',
        'businessName'          => 'chsAlpha',
        'phone'                 => 'mobile',
        'deliverMoney'          => 'number|between:0,100',
        'startDeliver'          => 'number|between:0,100',
        'startTime'             => 'date',
        'endTime'               => 'date',
        'provide'               => 'chs|length:1,10',
        'city'                  => 'chs|length:1,10',
        'county'                => 'chs|length:1,10',
        'businessAddress'       => 'chsAlphaNum|length:1,10',
        'businessDesc'          => 'chsAlphaNum|length:0,50'
    ];

    protected $message = [
        'businessType.number'           =>  '商家类型只能是快餐或正餐',
        'businessName.chsAlpha'         =>  '商家名只能填写中文或英文',
        'phone.mobile'                  =>  '请输入正确的号码',
        'deliverMoney.number'           =>  '配送费不得超过100',
        'startDeliver.number'           =>  '起送价格不得超过100',
        'startTime.date'                =>  '请选择正确的开始营业时间',
        'endTime.date'                  =>  '请选择正确的结束营业时间',
        'provide.chs'                   =>  '请输入正确的省份',
        'provide.length'                =>  '请输入正确的省份',
        'city.chs'                      =>  '请输入正确的城市',
        'city.length'                   =>  '请输入正确的城市',
        'county.chs'                    =>  '请输入正确的区',
        'county.length'                 =>  '请输入正确的区',
        'businessAddress.chsAlphaNum'   =>  '请输入正确的地址',
        'businessAddress.length'        =>  '请输入正确的地址',
        'businessDesc.chsAlphaNum'      =>  '请勿填写字符型',
        'businessDesc.length'           =>  '填写简介的长度只能是0-50个字符'
    ];
}